Passed
Push — master ( e95921...ddbd1b )
by Dimas
13:28 queued 05:15
created

roles.js ➔ deleteRole   A

Complexity

Conditions 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
dl 0
loc 3
rs 10
1
function deleteRole(role) {
2
  console.log(getFuncName(), role);
0 ignored issues
show
Debugging Code introduced by
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
3
}
4
AjaxForm();
5
6
jQuery(document).ready(function () {
7
  load_module(["select2"], function () {
8
    var dataSource = [];
9
    /**
10
     * @type {string[]}
11
     */
12
    var dataIntangible = selectOptions;
13
    dataIntangible.forEach(function (data, index) {
14
      dataSource.push({ text: data, id: data });
15
    });
16
    //console.log(dataSource);
17
    jQuery('[id^="select-"]').each(function (index, value) {
18
      jQuery(this).select2({
19
        data: dataSource,
20
        theme: "material",
21
        placeholder: "Select a route",
22
        allowClear: true,
23
        templateSelection: function (data) {
24
          if (data.id === "") {
25
            // adjust for custom placeholder values
26
            return "Custom styled placeholder text";
27
          }
28
29
          return data.text;
30
        },
31
      });
32
      var val = jQuery(this).data("key");
33
      console.log(val);
0 ignored issues
show
Debugging Code introduced by
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
34
    });
35
  });
36
});
37